﻿using System;
using System.Web;
using System.Web.Hosting;
using OpenWaves;
using OpenWaves.ActivityFeed;
using OpenWaves.ActivityFeed.RavenDB;
using OpenWaves.ActivityFeed.Web;
using OpenWaves.ActivityFeed.Web.Tests;

namespace ActivityFeed.Web_Net35.Tests
{
    public class Global : HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {
#if DEBUG
            HostingEnvironment.RegisterVirtualPathProvider(new ReferencedProjectVirtualPathProvider("ActivityFeed.Web"));
#endif
            /*
            var resolver = new BasicResolver();
            resolver.Register<IUserProfileProvider>(new FakeUserProfileProvider());
            resolver.Register<IDocumentSessionProvider>(new DocumentSessionPerRequestProvider());
            ServiceLocator.SetResolver(resolver);
            */

            // !!! N O T   I M P L E M E N T E D !!!
            // type DocumentSessionPerRequestProvider is not implemented for 3.5
            /*var resolver = new BasicResolver();
            resolver.Register<IDocumentSessionProvider>(new DocumentSessionPerRequestProvider());
            ServiceLocator.SetResolver(resolver);
            resolver.Register<IActivityFeedService>(new ActivityFeedService());*/
        }

        protected void Session_Start(object sender, EventArgs e)
        {
            OpenWaves.Web.AssemblyResourceVirtualPathProvider.EnsureRegistered();
        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}